package com.example.mapper;

import com.example.entity.Sing;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作sing相关数据接口
*/
public interface SingMapper {

    /**
      * 新增
    */
    int insert(Sing sing);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(Sing sing);

    /**
      * 根据ID查询
    */
    Sing selectById(Integer id);

    /**
      * 查询所有
    */
    List<Sing> selectAll(Sing sing);

    @Select("select * from sing order by hot desc limit 5")
    List<Sing> selectTop5();

    @Select("select * from sing where album_id = #{albumId} order by hot limit 3")
    List<Sing> selectTop3ByAlbumId(Integer albumId);
}